<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    protected $table = 'zd_users';


    //获取用户列表
    static function list(){

        $where = [];
        $model = self::where($where)
            ->get();

        return $model;
    }

    //通过openid获取用户
    static function findUser($openid){

        $wehre = [
            'openid'=>$openid
        ];

        $model = self::where($wehre)
            ->first();

        return $model;
    }

    //通过用户id获取用户
    static function uidgetUser($uid){

        $wehre = [
            'id'=>$uid
        ];

        $model = self::where($wehre)
            ->first();

        return $model;
    }

    //添加用户
    static function adduser($insert){

//        $insert['created_at'] = d;

        $in = self::insert($insert);

        return $in;
    }

}
